package com.basic.java.spring5;

/**
 * 类
 * 创建时间：2022/3/1 22:08
 * 演示 set 方法注入属性
 *
 * @author gejin
 */
public class Book {
    private String bName;
    private String bAuthor;
    private String address;

    public Book() {

    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getbName() {
        return bName;
    }

    public String getbAuthor() {
        return bAuthor;
    }

    public void setbName(String bName) {
        this.bName = bName;
    }

    public void setbAuthor(String bAuthor) {
        this.bAuthor = bAuthor;
    }

    public Book(String bName) {
        this.bName = bName;
    }

    public void testDemo() {
        System.out.println(bName + "--->" + bAuthor + "--->" + address);
    }

    public static void main(String[] args) {
        // set 方法注入
        Book book = new Book();
        book.setbName("Abc");

        // 有参构造注入
        Book book1 = new Book("abc");

    }
}
